<extend name="CigoAdminLib@Common/pageContent"/>

<block name="head-bottom">
	<style type="text/css">
		body {
			padding: 8px;
		}

		.navbar {
			padding: 6px;
		}

		.navbar > div,
		.navbar > div label,
		.navbar > div .controls {
			float: left;
		}
	</style>
</block>

<block name="tool-bar-tabs">
	<li class="active"><a href="#">基础数据</a></li>
	<li><a href="#">图片管理</a></li>
</block>

<block name="tool-bar-btns">
	<a class="btn btn-success form_post" formId="form" href="<<{:U('edit')}>>">
		<i class="fa fa-check"></i>
		保存修改
	</a>
</block>

<block name="content">
	<form id="form">
		<div id="content-tabs" class="tab-content">
			<div class="tab-pane active">
				<div class="form-group">
					<div class="cigo-edit item-input" cigo-edit-type="hidden" cigo-edit-value="<<{$data['id']}>>"
					     cigo-edit-name="id"></div>
				</div>
				<div class="form-group">
					<div class="cigo-edit item-input" cigo-edit-label="标题" cigo-edit-type="text"
					     cigo-edit-class="form-control" cigo-edit-style="width:260px;"
					     cigo-edit-value="<<{$data['title']}>>"
					     cigo-edit-name="title" cigo-edit-placeholder="请输入标题..."></div>
				</div>


				<div class="form-group">
					<div class="cigo-edit item-radio"
					     cigo-edit-type="landscape"
					     cigo-edit-name="radio_landscape"
					     cigo-edit-label="横向Radio"
					     cigo-edit-fun-value-changed="radioLandScapeChanged"
					     cigo-edit-placeholder="横向Radio管理"
					     cigo-edit-data-radio-options='<<{$radio_checkbox_options_list}>>'
					     cigo-edit-value="<<{$data['radio_landscape']}>>"
					></div>
				</div>

				<div class="form-group">
					<div class="cigo-edit item-radio"
					     cigo-edit-type="portrait"
					     cigo-edit-name="radio_portrait"
					     cigo-edit-value="<<{$data['radio_portrait']}>>"
					     cigo-edit-label="纵向Radio"
					     cigo-edit-fun-value-changed="radioPortraitChanged"
					     cigo-edit-placeholder="纵向Radio管理"
					     cigo-edit-data-radio-options='<<{$radio_checkbox_options_list}>>'
					></div>
				</div>

				<div class="form-group">
					<div class="cigo-edit item-checkbox"
					     cigo-edit-type="landscape"
					     cigo-edit-name="checkbox_landscape"
					     cigo-edit-value='<<{$data["checkbox_landscape"]}>>'
					     cigo-edit-label="横向Checkbox"
					     cigo-edit-fun-value-changed="checkboxLandScapeChanged"
					     cigo-edit-placeholder="横向Checkbox管理"
					     cigo-edit-data-checkbox-options='<<{$radio_checkbox_options_list}>>'
					></div>
				</div>

				<div class="form-group">
					<div class="cigo-edit item-checkbox"
					     cigo-edit-type="portrait"
					     cigo-edit-name="checkbox_portrait"
					     cigo-edit-value='<<{$data["checkbox_portrait"]}>>'
					     cigo-edit-label="纵向Checkbox"
					     cigo-edit-fun-value-changed="checkboxPortraitChanged"
					     cigo-edit-placeholder="纵向Checkbox管理"
					     cigo-edit-data-checkbox-options='<<{$radio_checkbox_options_list}>>'
					></div>
				</div>


				<div class="form-group">
					<div class="cigo-edit item-select" cigo-edit-label="消息提示Label样式"
					     cigo-edit-name="label-class" cigo-edit-value="<<{$data['label-class']}>>"
					     cigo-edit-data-select-options='<<{$label_class_list}>>' cigo-edit-select-width="150"
					     cigo-edit-fun-createitem="selectItemLabelClass"
					     cigo-edit-helpblock="提示Label使用Bootstrap标签样式"></div>
				</div>

				<div class="form-group">
					<div class="cigo-edit item-input" cigo-edit-label="排序" cigo-edit-type="text"
					     cigo-edit-class="form-control" cigo-edit-style="width:260px;"
					     cigo-edit-name="sort" cigo-edit-value="<<{$data['sort']}>>"
					     cigo-edit-placeholder="请输入排序数字..."
					     cigo-edit-helpblock="排序将根据数值大小倒序, 默认为50"></div>
				</div>

				<div class="form-group">
					<div class="cigo-edit item-datetimepicker" cigo-edit-label="创立日期"
					     cigo-edit-datetime-format="yyyy-mm-dd"
					     cigo-edit-class="form-control" cigo-edit-style="width:260px;"
					     cigo-edit-name="build-date" cigo-edit-value="<<{$data['build-date']}>>"
					     cigo-edit-readonly="readonly" cigo-edit-datetime-minview="month"
					     cigo-edit-placeholder="请选择日期时间..." cigo-edit-helpblock="用于日期类数据"></div>
				</div>

				<div class="form-group">
					<div class="cigo-edit item-datetimepicker" cigo-edit-label="创建日期时间"
					     cigo-edit-datetime-format="yyyy-mm-dd hh:ii"
					     cigo-edit-class="form-control" cigo-edit-style="width:260px;"
					     cigo-edit-name="create_time" cigo-edit-value="<<{$data['create_time']}>>"
					     cigo-edit-readonly="readonly" cigo-edit-datetime-minview="hour"
					     cigo-edit-placeholder="请选择日期时间..." cigo-edit-helpblock="数据创建时间"></div>
				</div>

				<div class="form-group">
					<div class="cigo-edit item-textarea" cigo-edit-label="简 介"
					     cigo-edit-class="form-control" cigo-edit-style="width:500px;"
					     cigo-edit-rows="5" cigo-edit-name="summary"
					     cigo-edit-value="<<{$data['summary']}>>"
					     cigo-edit-placeholder="请输入商品简介..."></div>
				</div>
			</div>

			<div class="tab-pane">
				<div class="panel panel-info">
					<div class="panel-heading">配置参数直接上传型</div>
					<div class="panel-body">
						<div class="cigo-edit item-img-single"
						     cigo-edit-label="单张图片" cigo-edit-name="img-s1"
						     cigo-edit-helpblock="单个图片上传，点击图片可以修改，放置鼠标可放大预览图片,选择图片直接上传，并且提示上传进度"></div>
					</div>
				</div>

				<hr/>
			</div>
		</div>
		<div class="form-group btn-group">
			<a class="btn btn-success btn-default form_post" href="<<{:U('edit')}>>" formId="form">修 改</a>
			<a class="btn btn-warning btn-default" href="#" onclick="history.go(-1);">返 回</a>
		</div>
	</form>
</block>

<block name="js-footer">
	<script type="text/javascript">
		function selectItemLabelClass(item) {
			var $itemView = $(
				'<span class="label ' + item.id + '">样式</span><span>&nbsp;&nbsp;' + item.text + '</span>'
			);
			return $itemView;
		}

		function radioLandScapeChanged(value) {
			console.log('radioLandScapeChanged:' + value);
		}

		function radioPortraitChanged(value) {
			console.log('radioPortraitChanged:' + value);
		}

		function checkboxLandScapeChanged(value) {
			console.log('checkboxLandScapeChanged:' + JSON.stringify(value));
		}

		function checkboxPortraitChanged(value) {
			console.log('checkboxPortraitChanged:' + JSON.stringify(value));
		}

	</script>
</block>
